package com.goods.service;

import com.goods.entity.Goods;
import com.goods.model.Page;

import java.sql.SQLException;
import java.util.List;

/**
 * 商品业务逻辑接口
 * @author huangyanzhong
 * @date 2020-04-01
 */
public interface GoodsService {

    /**
     * 新增商品
     * @param goods
     */
    void insert(Goods goods) throws Exception;

    /**
     * 修改商品
     * @param goods
     */
    void update(Goods goods) throws Exception;

    /**
     * 获取商品详情
     * @param id
     * @return
     */
    Goods get(String id) throws Exception;

    /**
     * 删除商品
     * @param id
     */
    void delete(String id) throws Exception;

    /**
     * 查询商品
     * @param sample
     * @param page
     * @return
     */
    List<Goods> query(Goods sample, Page page) throws Exception;

    /**
     * 统计商品
     * @param sample
     * @return
     */
    long count(Goods sample) throws Exception;

}
